package com.kfm.jdbc.day0329;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;

public class Demo06 {

    public static void main(String[] args) {
        try (FileOutputStream fileOutputStream = new FileOutputStream("d:\\io\\file-out.txt", false);){
//            fileOutputStream.write(99);
//            fileOutputStream.write(100);

            fileOutputStream.write("你好a".getBytes("utf-8"), 0, 6);
            fileOutputStream.flush();

        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
